import time
from collections.abc import Iterator

class SkipNine:
    def __init__(self, n):  # 20
        self.n = n
        self.numcount = 0

    def __iter__(self):
        return self

    def __next__(self):
        self.numcount += 1
        while True:
            if self.numcount > self.n:
                raise StopIteration  # 异常捕获
            elif '9' in str(self.numcount):
                self.numcount += 1  # 更改numcount的值
            else:
                return self.numcount


asd = SkipNine(100)  # 迭代器
print(isinstance(asd, Iterator))
for i in asd:
    print(i)
    # time.sleep(0.5)

"""
后面的课程马上就开始了 
预习资料找班主任去获取  建议爬虫数据分析全栈都获取
然后好好去预习   等着上课  ！！！！ 
"""
